<?php

/**
 * ViviendasBanner filter form base class.
 *
 * @package    costabravasfr
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseViviendasBannerFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'nombre'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'fecha_inicio_dest' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'fecha_fin_dest'    => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'texto_ca'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'texto_es'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'texto_en'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'texto_nl'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'texto_fr'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'nombre'            => new sfValidatorPass(array('required' => false)),
      'fecha_inicio_dest' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'fecha_fin_dest'    => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'texto_ca'          => new sfValidatorPass(array('required' => false)),
      'texto_es'          => new sfValidatorPass(array('required' => false)),
      'texto_en'          => new sfValidatorPass(array('required' => false)),
      'texto_nl'          => new sfValidatorPass(array('required' => false)),
      'texto_fr'          => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('viviendas_banner_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ViviendasBanner';
  }

  public function getFields()
  {
    return array(
      'iddestacadas'      => 'Number',
      'nombre'            => 'Text',
      'fecha_inicio_dest' => 'Date',
      'fecha_fin_dest'    => 'Date',
      'texto_ca'          => 'Text',
      'texto_es'          => 'Text',
      'texto_en'          => 'Text',
      'texto_nl'          => 'Text',
      'texto_fr'          => 'Text',
    );
  }
}
